<?php
/**
 * 角色管理
 *
 */

namespace dragon\User;

use dragon\Company\Entity\Company;
use think\Db;
use think\Model;

class Role extends Model {

    public function getCompanyNameAttr() {
        if($this->company_id) {
            return Db::name('company')->where('id', $this->company_id)->value('name');
        } else {
            return '系统';
        }
    }
}